const express = require('express')

const app = express()

app.use('/uploads', express.static(__dirname + '/uploads'))

app.use('/',(req,res) => {
  res.send(`
    <html>
      <style>
        html body {
          width: 100%;
          height: 100%;
        }
        div {
          width:500px;
          position: relative;
          font-size: 30px;
          color: green;
          background: #ccc;
          text-align: center
        }
      </style>
      <body>
        <div>这是一个测试项目</div>
        <img src="/uploads/1.jpg" />
      </body>
    </html>
  `)
})

app.listen(3002, ()=>{
  console.log('服务器连上');
})